import request from '@/utils/request'

// 查询交易帐期列表
export function listTransactionaccount(query) {
  return request({
    url: '/fang/transactionaccount/list',
    method: 'get',
    params: query
  })
}

// 查询交易帐期详细
export function getTransactionaccount(id) {
  return request({
    url: '/fang/transactionaccount/' + id,
    method: 'get'
  })
}

export function confirmPayment(id) {
  return request({
    url: '/fang/transactionaccount/confirm/' + id,
    method: 'put'
  })
}


// 修改交易帐期
export function updateTransactionaccount(data) {
  return request({
    url: '/fang/transactionaccount',
    method: 'put',
    data: data
  })
}


/////////////////



// 删除交易帐期
export function delTransactionaccount(id) {
  return request({
    url: '/fang/transactionaccount/' + id,
    method: 'delete'
  })
}

// 新增交易帐期
export function addTransactionaccount(data) {
  return request({
    url: '/fang/transactionaccount',
    method: 'post',
    data: data
  })
}

// 查询统计信息
export function getStatistics() {
  return request({
    url: '/fang/transactionaccount/statistics',
    method: 'get'
  })
}

// 已作废
export function obsoleteTransactionaccount(data) {
  return request({
    url: '/fang/transactionaccount/obsolete',
    method: 'put',
    data: data
  })
}

// 审核不通过
export function rejectTransactionaccount(data) {
  return request({
    url: '/fang/transactionaccount/rejected',
    method: 'put',
    data: data
  })
}

// 确认收款
export function tenantConfirmTransactionaccount(data) {
  return request({
    url: '/fang/transactionaccount/tenant-confirm',
    method: 'put',
    data: data
  })
}

// 导出交易帐期
export function exportTransactionaccount(ids) {
  return request({
    url: '/fang/transactionaccount/export',
    method: 'post',
    data: ids,
    responseType: 'blob'
  })
}
